/**
 * Copyright (c) 2009, http://www.softwareinlife.com. All rights reserved.
 * 
 * Redistribution and use in source and binary forms, 
 * with or without modification, are permitted provided that 
 * the following conditions are met:
 * 
 * 1. Redistributions of source code must retain the above copyright notice, 
 *    this list of conditions and the following disclaimer.
 * 
 * 2. Redistributions in binary form must reproduce the above copyright notice, 
 *    this list of conditions and the following disclaimer in the documentation 
 *    and/or other materials provided with the distribution.
 * 
 * 3. Neither the name of the http://www.softwareinlife.com nor the names of its 
 *    contributors may be used to endorse or promote products derived from 
 *    this software without specific prior written permission.
 * 
 * THIS SOFTWARE IS PROVIDED BY THE SOFTWAREINLIFE AND CONTRIBUTORS "AS IS" 
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 
 * ARE DISCLAIMED. 
 * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 
 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 
 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
package com.softwareinlife.vision.android.ux.init;

import java.util.ArrayList;
import java.util.List;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Spinner;

import com.softwareinlife.vision.android.R;

/**
 * @author Kang, tae-ho (usteam@softwareinlife.com)
 * @date 2009. 10. 11.
 */
public class NetworkActivity extends Activity {

	/*************** spinner ************************/
	private static final CharSequence[] Server_connect_sequence = { "Bluethus",
			"ETC1", "ETC2", "ETC3" };

	private List<CharSequence> Level_List;// ?�피??목록
	private ArrayAdapter<CharSequence> Server_connect_Adapter;// 목록??받아??객체
	private Spinner Server_connect_Spinner;// ?�피??객체

	// private TextView Level_View;//?�택??목록??보여�??�스??

	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.network);

		/********************* spinner *******************************/
		// Level_View = (TextView) findViewById(R.id.Current_Level);
		Server_connect_Spinner = (Spinner) findViewById(R.id.server_connection);
		Level_List = new ArrayList<CharSequence>();

		for (CharSequence level : Server_connect_sequence) {
			Level_List.add(level);
		}

		Server_connect_Adapter = new ArrayAdapter<CharSequence>(this,
				android.R.layout.simple_spinner_item, Level_List);

		Server_connect_Adapter
				.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);

		Server_connect_Spinner.setAdapter(Server_connect_Adapter);

		Server_connect_Spinner.setOnItemSelectedListener(ServerSelectListener);

		Server_connect_Spinner.setSelection(0);
	}

	/************************ spinner ********************************************/
	private Spinner.OnItemSelectedListener ServerSelectListener = new Spinner.OnItemSelectedListener() {
		@SuppressWarnings("unchecked")
		public void onItemSelected(AdapterView parent, View v, int position,
				long id) {

		}

		@SuppressWarnings("unchecked")
		public void onNothingSelected(AdapterView parent) {

		}
	};

}